#include <bits/stdc++.h>

using namespace std;

int number[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

int vis[100][100] = {0};

int temp[100][100] = {0};

int ans = 0;

int n = 0;

int count_xiaohao(int a){
    int temp = 0;
    if(a == 0)
        return number[0];
    int flag = 0;
    while(a > 0 && flag < 3){
        temp += number[a % 10];
        a /= 10;
        flag ++;
    }
    return temp;
}

void count_temp(int a)
{
    for(int i = 0; i < 1000; i++)
    {
        for(int j = i; j < 1000; j++){
            int sum = count_xiaohao(i) + count_xiaohao(j) + count_xiaohao(i + j);
            if(sum == n) {
                if(j == i)ans++;
                else ans += 2;
            }
        }
    }
}

int main(){
    cin >> n;
    n = n - 4;
    count_temp(n);
    std::cout << ans;

    return 0;
}